<template>
  <section>
    <h2>{{ title }}</h2>
    <ComUser ref="conuser"></ComUser>
    <api name="api-name" ref="api"></api>
  </section>
</template>

<script>
import { Component, ref, onMounted } from "vue";
import ComUser from "./pages/com-user";
import api from "./pages/api";
export default {
  components: {
    ComUser, api
  },
  setup() {
    // const conu = ref(null)
    const api = ref(null)
    console.log('------');
    
    // console.log(conu.value.get);
    
    onMounted(() => {
      //获取子组件实例，调用其内部函数
      console.log(api.value.refTest);
    })
    return {
      title: "Hello Vue3.0",
    };
  },
};
</script>

<style>
body {
  padding: 50px;
  color: #42b983;
  text-align: center;
  background-color: #282c34;
}
</style>
